package com.yanyeori.framework.core.interfaces;

import java.util.Collection;
import java.util.Map;
import java.util.Set;
import java.util.function.Function;

/**
 * 缓存Map接口
 *
 * @author chenkuan 2020/12/1
 */
public interface CacheMap<K, V> {
    int size();

    boolean isEmpty();

    boolean containsKey(Object key);

    boolean containsValue(Object value);

    V get(Object key);

    V put(K key, V value);

    V put(K key, V value, long expireTime);

    V remove(Object... keys);

    void putAll(Map<? extends K, ? extends V> m);

    void clear();

    V getOrDefault(Object key, V defaultValue);

    V computeIfAbsent(K key, Function<? super K, ? extends V> mappingFunction);

    Set<K> keySet();

    Collection<V> values();
}
